package siga.visao;
import java.sql.SQLException;
import siga.visao_cpa.*;
import siga.visao_academico.*;
import siga.visao_financeiro.*;
import java.beans.PropertyVetoException;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;

import javax.swing.JTextField;
import siga.banco.conexao;
import siga.pacotao.converteData;
import siga.pacotao.lexicoArquivo;


public class index extends javax.swing.JFrame {
    public static String cod_emp,bd,usbd,snbd,relatorio,jasper,raiz;
    public static String usuario[] = new String[10];
    public static List empresa = new ArrayList();
    public static List periodo = new ArrayList();
    
    /* Estudar Nessecidades destas listas */
    public static List LRpessoa = new ArrayList();
    public static List LRdisciplina = new ArrayList();
    public static List LRcurso = new ArrayList();
    public static List LRturma = new ArrayList();
    public static List LRfase = new ArrayList();
    public static List LRplanopag = new ArrayList();
    public static List LRsalaselaboratorios = new ArrayList();
    public static List LRcontas = new ArrayList();
    public static List LRcentro = new ArrayList();
    public static List LRbanco = new ArrayList();
    public static List pesquisa = new ArrayList();
    
    public static DecimalFormat ftbr = new DecimalFormat("#,##0.00");
    public static NumberFormat ftes = NumberFormat.getInstance(new Locale("pt", "BR"));
    public static converteData dtcv = new converteData();

    public static String dataAgoraBR="";
    public static java.awt.Dimension tela = java.awt.Toolkit.getDefaultToolkit().getScreenSize();

    //Lista de Janelas Acadêmicas
    relGerenciador_academico rg = new relGerenciador_academico();
    GestaoCadCurso gcc = new GestaoCadCurso();
    GestaoCadDisciplina gcd = new GestaoCadDisciplina();
    GestaoGradeCurricular ggc = new GestaoGradeCurricular();
    GestaoCadTurma gct = new GestaoCadTurma();
    GestaoMatricular gm = new GestaoMatricular();
    GestaoDiarios gd = new GestaoDiarios();
    GestaoTurmaProfessor gvp = new GestaoTurmaProfessor();
    CadastroAgendaDiario gqh = new CadastroAgendaDiario();
    CadastroPessoas cp = new CadastroPessoas();
    CadastroAcademico cpa = new CadastroAcademico();
    CadastroProfessor cpp = new CadastroProfessor();
    CadastroUsuarios cu = new CadastroUsuarios();
    CadatroQuadroHorario cqh = new CadatroQuadroHorario();
    CadastroSalasLaboratorios csl = new CadastroSalasLaboratorios();
    Atividade_Complementar_Tela act = new Atividade_Complementar_Tela();
    Dispensa_Disciplina_Tela ddt = new Dispensa_Disciplina_Tela();

    //Lista de Janelas CPA
    cpa_ver_autorizados cva = new cpa_ver_autorizados();
    cpa_cad_avaliacao ca = new cpa_cad_avaliacao();
    cpa_cad_grupo cg = new cpa_cad_grupo();
    cpa_cad_subgrupo csg = new cpa_cad_subgrupo();
    cpa_cad_questoes cq = new cpa_cad_questoes();
    cpa_autorizados cpaa = new cpa_autorizados();

    //Lista de Janelas Financeiras
    relGerenciador_financeiro rgf = new relGerenciador_financeiro();
    cadFornecedorVer cfv = new cadFornecedorVer();
    cadBancoVer cbv = new cadBancoVer();
    cadClasRetornoChequeVer ccrcv = new cadClasRetornoChequeVer();
    cadPlanoPagVer cppv = new cadPlanoPagVer();
    LoginVer lgv = new LoginVer();
    cadPlanoContas cpcv = new cadPlanoContas();
    cadCentroCustoVer cccv = new cadCentroCustoVer();
    movCaixaVer mcv = new movCaixaVer();
    movContasReceber mcr = new movContasReceber();
    movContasPagar mcp = new movContasPagar();
    MemoCadContaBanco mccb = new MemoCadContaBanco();
    MemoImportacao mi = new MemoImportacao();

    public index() {
        LRpessoa.clear();
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        desktopPane = new javax.swing.JDesktopPane();
        jToolBar1 = new javax.swing.JToolBar();
        jButton1 = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JToolBar.Separator();
        jButton2 = new javax.swing.JButton();
        jSeparator8 = new javax.swing.JToolBar.Separator();
        jToggleButton1 = new javax.swing.JToggleButton();
        jSeparator9 = new javax.swing.JToolBar.Separator();
        jlRelogio = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JToolBar.Separator();
        jbAnoSemestre = new javax.swing.JButton();
        menuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        jMenu7 = new javax.swing.JMenu();
        jMenuItem29 = new javax.swing.JMenuItem();
        jMenuItem30 = new javax.swing.JMenuItem();
        jMenuItem31 = new javax.swing.JMenuItem();
        jMenuItem23 = new javax.swing.JMenuItem();
        exitMenuItem = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem32 = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        jMenuItem22 = new javax.swing.JMenuItem();
        jMenuItem21 = new javax.swing.JMenuItem();
        jSeparator12 = new javax.swing.JPopupMenu.Separator();
        jMenuItem27 = new javax.swing.JMenuItem();
        jMenuItem28 = new javax.swing.JMenuItem();
        jMenu5 = new javax.swing.JMenu();
        jMenuItem16 = new javax.swing.JMenuItem();
        jMenuItem17 = new javax.swing.JMenuItem();
        jMenuItem18 = new javax.swing.JMenuItem();
        jMenuItem19 = new javax.swing.JMenuItem();
        jSeparator6 = new javax.swing.JPopupMenu.Separator();
        jMenuItem15 = new javax.swing.JMenuItem();
        jSeparator7 = new javax.swing.JPopupMenu.Separator();
        jMenuItem20 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenu11 = new javax.swing.JMenu();
        jMenuItem7 = new javax.swing.JMenuItem();
        jMenuItem8 = new javax.swing.JMenuItem();
        jMenu12 = new javax.swing.JMenu();
        jMenuItem10 = new javax.swing.JMenuItem();
        jMenuItem6 = new javax.swing.JMenuItem();
        jMenuItem12 = new javax.swing.JMenuItem();
        jMenu13 = new javax.swing.JMenu();
        jMenuItem24 = new javax.swing.JMenuItem();
        jMenuItem25 = new javax.swing.JMenuItem();
        jMenu14 = new javax.swing.JMenu();
        jMenuItem11 = new javax.swing.JMenuItem();
        jMenuItem13 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenu15 = new javax.swing.JMenu();
        jMenuItem14 = new javax.swing.JMenuItem();
        jMenuItem9 = new javax.swing.JMenuItem();
        jMenu6 = new javax.swing.JMenu();
        jMenu9 = new javax.swing.JMenu();
        jMenuItem36 = new javax.swing.JMenuItem();
        jMenuItem37 = new javax.swing.JMenuItem();
        jMenuItem38 = new javax.swing.JMenuItem();
        jMenuItem39 = new javax.swing.JMenuItem();
        jMenuItem40 = new javax.swing.JMenuItem();
        jMenu8 = new javax.swing.JMenu();
        jMenuItem33 = new javax.swing.JMenuItem();
        jMenuItem34 = new javax.swing.JMenuItem();
        jMenuItem35 = new javax.swing.JMenuItem();
        jMenu10 = new javax.swing.JMenu();
        jMenuItem41 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem42 = new javax.swing.JMenuItem();
        helpMenu = new javax.swing.JMenu();
        jMenuItem43 = new javax.swing.JMenuItem();
        aboutMenuItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("SIGA - Sistema de Integração e Gestão Educaional :: V.6.4"); // NOI18N
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setIconImage(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/siga.png")).getImage());
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosed(java.awt.event.WindowEvent evt) {
                formWindowClosed(evt);
            }
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        jToolBar1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);
        jToolBar1.setName("jToolBar1"); // NOI18N

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/user_16x16.png"))); // NOI18N
        jButton1.setText("Logado por");
        jButton1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton1);

        jSeparator1.setName("jSeparator1"); // NOI18N
        jToolBar1.add(jSeparator1);

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/erro_sistema_16.png"))); // NOI18N
        jButton2.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jButton2.setFocusable(false);
        jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton2.setName("jButton2"); // NOI18N
        jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton2);

        jSeparator8.setName("jSeparator8"); // NOI18N
        jToolBar1.add(jSeparator8);

        jToggleButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/flag_brt_16.png"))); // NOI18N
        jToggleButton1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jToggleButton1.setFocusable(false);
        jToggleButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jToggleButton1.setName("jToggleButton1"); // NOI18N
        jToggleButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(jToggleButton1);

        jSeparator9.setName("jSeparator9"); // NOI18N
        jToolBar1.add(jSeparator9);

        jlRelogio.setFont(new java.awt.Font("SansSerif", 0, 11)); // NOI18N
        jlRelogio.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jlRelogio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/time_16.png"))); // NOI18N
        jlRelogio.setText("23:00:00 14/05/2009");
        jlRelogio.setName("jlRelogio"); // NOI18N
        jToolBar1.add(jlRelogio);

        jSeparator2.setName("jSeparator2"); // NOI18N
        jToolBar1.add(jSeparator2);

        jbAnoSemestre.setText("2011/B");
        jbAnoSemestre.setFocusable(false);
        jbAnoSemestre.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jbAnoSemestre.setName("jbAnoSemestre"); // NOI18N
        jbAnoSemestre.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jbAnoSemestre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbAnoSemestreActionPerformed(evt);
            }
        });
        jToolBar1.add(jbAnoSemestre);

        menuBar.setBackground(new java.awt.Color(223, 222, 218));
        menuBar.setForeground(new java.awt.Color(254, 254, 254));

        fileMenu.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/siga_16x16.png"))); // NOI18N
        fileMenu.setText("Sistema");

        jMenu7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/Users_Group_16x16.png"))); // NOI18N
        jMenu7.setText("Administrador");
        jMenu7.setName("jMenu7"); // NOI18N

        jMenuItem29.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/Business_People_16x16.png"))); // NOI18N
        jMenuItem29.setText("Cadastro de Usuários");
        jMenuItem29.setName("jMenuItem29"); // NOI18N
        jMenuItem29.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem29ActionPerformed(evt);
            }
        });
        jMenu7.add(jMenuItem29);

        jMenuItem30.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/fechado_16x16.png"))); // NOI18N
        jMenuItem30.setText("Controle de Permissão");
        jMenuItem30.setName("jMenuItem30"); // NOI18N
        jMenuItem30.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem30ActionPerformed(evt);
            }
        });
        jMenu7.add(jMenuItem30);

        jMenuItem31.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/Caixa_16x16.png"))); // NOI18N
        jMenuItem31.setText("Controle de Caixa");
        jMenuItem31.setName("jMenuItem31"); // NOI18N
        jMenu7.add(jMenuItem31);

        fileMenu.add(jMenu7);

        jMenuItem23.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/aberto_16x16.png"))); // NOI18N
        jMenuItem23.setText("Trocar Senha");
        jMenuItem23.setName("jMenuItem23"); // NOI18N
        jMenuItem23.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem23ActionPerformed(evt);
            }
        });
        fileMenu.add(jMenuItem23);

        exitMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/sair_16x16.png"))); // NOI18N
        exitMenuItem.setText("Sair");
        exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        jMenu1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/plano_pag_16x16.png"))); // NOI18N
        jMenu1.setText("Cadastros");
        jMenu1.setName("jMenu1"); // NOI18N

        jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/Business_People_16x16.png"))); // NOI18N
        jMenuItem1.setText("Cadastro de Pessoas");
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/Business_People_16x16.png"))); // NOI18N
        jMenuItem2.setText("Cadastro de Acadêmicos");
        jMenuItem2.setName("jMenuItem2"); // NOI18N
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem2);

        jMenuItem3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/Business_People_16x16.png"))); // NOI18N
        jMenuItem3.setText("Cadastro de Docente");
        jMenuItem3.setName("jMenuItem3"); // NOI18N
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem3);

        jMenuItem32.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/Business_People_16x16.png"))); // NOI18N
        jMenuItem32.setText("Cadastro de Fornecedor");
        jMenuItem32.setName("jMenuItem32"); // NOI18N
        jMenuItem32.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem32ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem32);

        menuBar.add(jMenu1);

        jMenu4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/audio_visual_16.png"))); // NOI18N
        jMenu4.setText("Audio Visual");
        jMenu4.setName("jMenu4"); // NOI18N

        jMenuItem22.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/audio_visual_novo_16.png"))); // NOI18N
        jMenuItem22.setText("Cadastro de Tipo do Material");
        jMenuItem22.setName("jMenuItem22"); // NOI18N
        jMenu4.add(jMenuItem22);

        jMenuItem21.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/audio_visual_novo_16.png"))); // NOI18N
        jMenuItem21.setText("Cadastro de Material");
        jMenuItem21.setName("jMenuItem21"); // NOI18N
        jMenu4.add(jMenuItem21);

        jSeparator12.setName("jSeparator12"); // NOI18N
        jMenu4.add(jSeparator12);

        jMenuItem27.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/audio_visual_add_16.png"))); // NOI18N
        jMenuItem27.setText("Reserva de Material");
        jMenuItem27.setName("jMenuItem27"); // NOI18N
        jMenu4.add(jMenuItem27);

        jMenuItem28.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/audio_visual_add_16.png"))); // NOI18N
        jMenuItem28.setText("Requisição de Material");
        jMenuItem28.setName("jMenuItem28"); // NOI18N
        jMenu4.add(jMenuItem28);

        menuBar.add(jMenu4);

        jMenu5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/cpa_menu.png"))); // NOI18N
        jMenu5.setText("CPA");
        jMenu5.setName("jMenu5"); // NOI18N

        jMenuItem16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/cpa_avaliacao_16.png"))); // NOI18N
        jMenuItem16.setText("Cadastro de Avaliações");
        jMenuItem16.setName("jMenuItem16"); // NOI18N
        jMenuItem16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem16ActionPerformed(evt);
            }
        });
        jMenu5.add(jMenuItem16);

        jMenuItem17.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/cpa_group.png"))); // NOI18N
        jMenuItem17.setText("Cadastro de Grupo");
        jMenuItem17.setName("jMenuItem17"); // NOI18N
        jMenuItem17.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem17ActionPerformed(evt);
            }
        });
        jMenu5.add(jMenuItem17);

        jMenuItem18.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/cpa_group.png"))); // NOI18N
        jMenuItem18.setText("Cadastro de SubGrupo");
        jMenuItem18.setName("jMenuItem18"); // NOI18N
        jMenuItem18.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem18ActionPerformed(evt);
            }
        });
        jMenu5.add(jMenuItem18);

        jMenuItem19.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/cpa_quest_16.png"))); // NOI18N
        jMenuItem19.setText("Cadastro de Questões");
        jMenuItem19.setName("jMenuItem19"); // NOI18N
        jMenuItem19.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem19ActionPerformed(evt);
            }
        });
        jMenu5.add(jMenuItem19);

        jSeparator6.setName("jSeparator6"); // NOI18N
        jMenu5.add(jSeparator6);

        jMenuItem15.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/cpa_completo.png"))); // NOI18N
        jMenuItem15.setText("Formulários Preenchidos");
        jMenuItem15.setName("jMenuItem15"); // NOI18N
        jMenuItem15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem15ActionPerformed(evt);
            }
        });
        jMenu5.add(jMenuItem15);

        jSeparator7.setName("jSeparator7"); // NOI18N
        jMenu5.add(jSeparator7);

        jMenuItem20.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/cpa_user.png"))); // NOI18N
        jMenuItem20.setText("Autorizados");
        jMenuItem20.setName("jMenuItem20"); // NOI18N
        jMenuItem20.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem20ActionPerformed(evt);
            }
        });
        jMenu5.add(jMenuItem20);

        menuBar.add(jMenu5);

        jMenu2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/centr_custo_16x16.png"))); // NOI18N
        jMenu2.setText("Gestão Acadêmica");
        jMenu2.setName("jMenu2"); // NOI18N

        jMenu11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/plano_pag_16x16.png"))); // NOI18N
        jMenu11.setText("Cadastros");
        jMenu11.setName("jMenu11"); // NOI18N

        jMenuItem7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/cheque_16x16.png"))); // NOI18N
        jMenuItem7.setText("Cadastro de Cursos");
        jMenuItem7.setName("jMenuItem7"); // NOI18N
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem7ActionPerformed(evt);
            }
        });
        jMenu11.add(jMenuItem7);

        jMenuItem8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/cheque_16x16.png"))); // NOI18N
        jMenuItem8.setText("Cadastro de Disciplinas");
        jMenuItem8.setName("jMenuItem8"); // NOI18N
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem8ActionPerformed(evt);
            }
        });
        jMenu11.add(jMenuItem8);

        jMenu2.add(jMenu11);

        jMenu12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/centr_custo_16x16.png"))); // NOI18N
        jMenu12.setText("Grades & Turmas");
        jMenu12.setName("jMenu12"); // NOI18N

        jMenuItem10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/planopag_16x16.png"))); // NOI18N
        jMenuItem10.setText("Gerar Grade Curricular");
        jMenuItem10.setName("jMenuItem10"); // NOI18N
        jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem10ActionPerformed(evt);
            }
        });
        jMenu12.add(jMenuItem10);

        jMenuItem6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/gerar_men_16x16.png"))); // NOI18N
        jMenuItem6.setText("Gerar Turmas");
        jMenuItem6.setName("jMenuItem6"); // NOI18N
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        jMenu12.add(jMenuItem6);

        jMenuItem12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/Business_People_16x16.png"))); // NOI18N
        jMenuItem12.setText("Distribuição de Aulas");
        jMenuItem12.setName("jMenuItem12"); // NOI18N
        jMenuItem12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem12ActionPerformed(evt);
            }
        });
        jMenu12.add(jMenuItem12);

        jMenu2.add(jMenu12);

        jMenu13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/obs_editar_16x16.png"))); // NOI18N
        jMenu13.setText("Extra Curricular");
        jMenu13.setName("jMenu13"); // NOI18N

        jMenuItem24.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/sobre_16x16.png"))); // NOI18N
        jMenuItem24.setText("Atividade Complementar");
        jMenuItem24.setName("jMenuItem24"); // NOI18N
        jMenuItem24.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem24ActionPerformed(evt);
            }
        });
        jMenu13.add(jMenuItem24);

        jMenuItem25.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/centr_custo_16x16.png"))); // NOI18N
        jMenuItem25.setText("Dispensa de Disciplinas");
        jMenuItem25.setName("jMenuItem25"); // NOI18N
        jMenuItem25.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem25ActionPerformed(evt);
            }
        });
        jMenu13.add(jMenuItem25);

        jMenu2.add(jMenu13);

        jMenu14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/matricula_16x16.png"))); // NOI18N
        jMenu14.setText("Matrículas & Diários");
        jMenu14.setName("jMenu14"); // NOI18N

        jMenuItem11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/matricular_16x16.png"))); // NOI18N
        jMenuItem11.setText("Matricular");
        jMenuItem11.setName("jMenuItem11"); // NOI18N
        jMenuItem11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem11ActionPerformed(evt);
            }
        });
        jMenu14.add(jMenuItem11);

        jMenuItem13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/diarios_16x16.png"))); // NOI18N
        jMenuItem13.setText("Diários");
        jMenuItem13.setName("jMenuItem13"); // NOI18N
        jMenuItem13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem13ActionPerformed(evt);
            }
        });
        jMenu14.add(jMenuItem13);

        jMenuItem5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/calendario_16.png"))); // NOI18N
        jMenuItem5.setText("Diários On-line");
        jMenuItem5.setName("jMenuItem5"); // NOI18N
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem5ActionPerformed(evt);
            }
        });
        jMenu14.add(jMenuItem5);

        jMenu2.add(jMenu14);

        jMenu15.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/sala_16.png"))); // NOI18N
        jMenu15.setText("Salas & Laboratórios");
        jMenu15.setName("jMenu15"); // NOI18N

        jMenuItem14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/sala_16.png"))); // NOI18N
        jMenuItem14.setText("Salas e Laboratórios");
        jMenuItem14.setName("jMenuItem14"); // NOI18N
        jMenuItem14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem14ActionPerformed(evt);
            }
        });
        jMenu15.add(jMenuItem14);

        jMenuItem9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/calendario_16.png"))); // NOI18N
        jMenuItem9.setText("Quadro de Horários");
        jMenuItem9.setName("jMenuItem9"); // NOI18N
        jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem9ActionPerformed(evt);
            }
        });
        jMenu15.add(jMenuItem9);

        jMenu2.add(jMenu15);

        menuBar.add(jMenu2);

        jMenu6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/banco_16x16.png"))); // NOI18N
        jMenu6.setText("Gestão Financeira");
        jMenu6.setName("jMenu6"); // NOI18N

        jMenu9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/plano_pag_16x16.png"))); // NOI18N
        jMenu9.setText("Cadastros");
        jMenu9.setName("jMenu9"); // NOI18N

        jMenuItem36.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/banco_16x16.png"))); // NOI18N
        jMenuItem36.setText("Bancos");
        jMenuItem36.setName("jMenuItem36"); // NOI18N
        jMenuItem36.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem36ActionPerformed(evt);
            }
        });
        jMenu9.add(jMenuItem36);

        jMenuItem37.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/cheque_16x16.png"))); // NOI18N
        jMenuItem37.setText("Clacificação de Retorno do Cheque");
        jMenuItem37.setName("jMenuItem37"); // NOI18N
        jMenuItem37.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem37ActionPerformed(evt);
            }
        });
        jMenu9.add(jMenuItem37);

        jMenuItem38.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/plano_pag_16x16.png"))); // NOI18N
        jMenuItem38.setText("Plano de Pagamento");
        jMenuItem38.setName("jMenuItem38"); // NOI18N
        jMenuItem38.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem38ActionPerformed(evt);
            }
        });
        jMenu9.add(jMenuItem38);

        jMenuItem39.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/planopag_16x16.png"))); // NOI18N
        jMenuItem39.setText("Plano de Contas");
        jMenuItem39.setName("jMenuItem39"); // NOI18N
        jMenuItem39.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem39ActionPerformed(evt);
            }
        });
        jMenu9.add(jMenuItem39);

        jMenuItem40.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/centr_custo_16x16.png"))); // NOI18N
        jMenuItem40.setText("Centro de Custos");
        jMenuItem40.setName("jMenuItem40"); // NOI18N
        jMenuItem40.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem40ActionPerformed(evt);
            }
        });
        jMenu9.add(jMenuItem40);

        jMenu6.add(jMenu9);

        jMenu8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/movimentacao_16x16.png"))); // NOI18N
        jMenu8.setText("Movimentação");
        jMenu8.setName("jMenu8"); // NOI18N

        jMenuItem33.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/Caixa_16x16.png"))); // NOI18N
        jMenuItem33.setText("Controle de Caixa");
        jMenuItem33.setName("jMenuItem33"); // NOI18N
        jMenuItem33.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem33ActionPerformed(evt);
            }
        });
        jMenu8.add(jMenuItem33);

        jMenuItem34.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/contasreceber_16x16.png"))); // NOI18N
        jMenuItem34.setText("Contas a Receber");
        jMenuItem34.setName("jMenuItem34"); // NOI18N
        jMenuItem34.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem34ActionPerformed(evt);
            }
        });
        jMenu8.add(jMenuItem34);

        jMenuItem35.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/contasreceber_16x16.png"))); // NOI18N
        jMenuItem35.setText("Contas a Pagar");
        jMenuItem35.setName("jMenuItem35"); // NOI18N
        jMenuItem35.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem35ActionPerformed(evt);
            }
        });
        jMenu8.add(jMenuItem35);

        jMenu6.add(jMenu8);

        jMenu10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/gerar_men_16x16.png"))); // NOI18N
        jMenu10.setText("Memorandos");
        jMenu10.setName("jMenu10"); // NOI18N

        jMenuItem41.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/sobre_16x16.png"))); // NOI18N
        jMenuItem41.setText("Gerar Memorandos");
        jMenuItem41.setName("jMenuItem41"); // NOI18N
        jMenu10.add(jMenuItem41);

        jMenu6.add(jMenu10);

        menuBar.add(jMenu6);

        jMenu3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/printer_16.png"))); // NOI18N
        jMenu3.setText("Relatórios");
        jMenu3.setName("jMenu3"); // NOI18N

        jMenuItem4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/printer_16.png"))); // NOI18N
        jMenuItem4.setText("Relatórios Academicos");
        jMenuItem4.setName("jMenuItem4"); // NOI18N
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem4);

        jMenuItem42.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/printer_16.png"))); // NOI18N
        jMenuItem42.setText("Relatórios Financeiros");
        jMenuItem42.setName("jMenuItem42"); // NOI18N
        jMenuItem42.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem42ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem42);

        menuBar.add(jMenu3);

        helpMenu.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/ajuda_16x16.png"))); // NOI18N
        helpMenu.setText("Ajuda");

        jMenuItem43.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/chat_16.png"))); // NOI18N
        jMenuItem43.setText("Atendimento On-Line");
        jMenuItem43.setName("jMenuItem43"); // NOI18N
        helpMenu.add(jMenuItem43);

        aboutMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/sobre_16x16.png"))); // NOI18N
        aboutMenuItem.setText("Sobre");
        aboutMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aboutMenuItemActionPerformed(evt);
            }
        });
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 854, Short.MAX_VALUE)
            .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 854, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitMenuItemActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        String args[] = new String[1];
        args[0]="";
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        verErros ver = new verErros(null,true);
        ver.setLocation((tela.width-ver.getWidth())/2, (tela.height-ver.getHeight())/2);
        ver.setVisible(true);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
        jButton1.setText("Logado por "+usuario[2]);
        jlRelogio.setText(new SimpleDateFormat("dd/MM/yyyy").format(new Date()));
        dataAgoraBR = jlRelogio.getText();
        conexao.Conexao();
        carregaAnoSemestre();
    }//GEN-LAST:event_formWindowOpened

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
        AbreJanela(gcc);
    }//GEN-LAST:event_jMenuItem7ActionPerformed

    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
        AbreJanela(gcd);
    }//GEN-LAST:event_jMenuItem8ActionPerformed

    private void jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem10ActionPerformed
        AbreJanela(ggc);
    }//GEN-LAST:event_jMenuItem10ActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        AbreJanela(gct);
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void aboutMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutMenuItemActionPerformed
        
    }//GEN-LAST:event_aboutMenuItemActionPerformed

    private void jMenuItem11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem11ActionPerformed
        AbreJanela(gm);
    }//GEN-LAST:event_jMenuItem11ActionPerformed

    private void jMenuItem13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem13ActionPerformed
        AbreJanela(gd);
    }//GEN-LAST:event_jMenuItem13ActionPerformed

    private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
        conexao.FechaConexao();
    }//GEN-LAST:event_formWindowClosed

    private void jMenuItem12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem12ActionPerformed
        AbreJanela(gvp);
    }//GEN-LAST:event_jMenuItem12ActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        AbreJanela(cp);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem15ActionPerformed
        AbreJanela(cva);
    }//GEN-LAST:event_jMenuItem15ActionPerformed

    private void jMenuItem16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem16ActionPerformed
        AbreJanela(ca);
    }//GEN-LAST:event_jMenuItem16ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        AbreJanela(cpa);
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        AbreJanela(cpp);
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem23ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem23ActionPerformed
        usuario_alterar ua = new usuario_alterar(null,true);
        ua.setLocation((index.tela.width-ua.getWidth())/2, (index.tela.height-ua.getHeight())/2);
        ua.setVisible(true);
    }//GEN-LAST:event_jMenuItem23ActionPerformed

    private void jMenuItem24ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem24ActionPerformed
        AbreJanela(act);
    }//GEN-LAST:event_jMenuItem24ActionPerformed

    private void jMenuItem25ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem25ActionPerformed
        AbreJanela(ddt);
    }//GEN-LAST:event_jMenuItem25ActionPerformed

    private void jMenuItem17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem17ActionPerformed
        AbreJanela(cg);
    }//GEN-LAST:event_jMenuItem17ActionPerformed

    private void jMenuItem18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem18ActionPerformed
        AbreJanela(csg);
    }//GEN-LAST:event_jMenuItem18ActionPerformed

    private void jMenuItem19ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem19ActionPerformed
        AbreJanela(cq);
    }//GEN-LAST:event_jMenuItem19ActionPerformed

    private void jMenuItem20ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem20ActionPerformed
        AbreJanela(cpaa);
    }//GEN-LAST:event_jMenuItem20ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        AbreJanela(rg);
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
        AbreJanela(gqh);
    }//GEN-LAST:event_jMenuItem5ActionPerformed

    private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
        AbreJanela(cqh);
    }//GEN-LAST:event_jMenuItem9ActionPerformed

    private void jMenuItem14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem14ActionPerformed
        AbreJanela(csl);
    }//GEN-LAST:event_jMenuItem14ActionPerformed

    private void jMenuItem42ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem42ActionPerformed
         AbreJanela(rgf);
    }//GEN-LAST:event_jMenuItem42ActionPerformed

    private void jMenuItem36ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem36ActionPerformed
        AbreJanela(cbv);
    }//GEN-LAST:event_jMenuItem36ActionPerformed

    private void jMenuItem37ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem37ActionPerformed
        AbreJanela(ccrcv);
    }//GEN-LAST:event_jMenuItem37ActionPerformed

    private void jMenuItem38ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem38ActionPerformed
        AbreJanela(cppv);
    }//GEN-LAST:event_jMenuItem38ActionPerformed

    private void jMenuItem39ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem39ActionPerformed
        AbreJanela(cpcv);
    }//GEN-LAST:event_jMenuItem39ActionPerformed

    private void jMenuItem40ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem40ActionPerformed
        AbreJanela(cccv);
    }//GEN-LAST:event_jMenuItem40ActionPerformed

    private void jMenuItem33ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem33ActionPerformed
        AbreJanela(mcv);
    }//GEN-LAST:event_jMenuItem33ActionPerformed

    private void jMenuItem34ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem34ActionPerformed
        AbreJanela(mcr);
    }//GEN-LAST:event_jMenuItem34ActionPerformed

    private void jMenuItem35ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem35ActionPerformed
        AbreJanela(mcp);
    }//GEN-LAST:event_jMenuItem35ActionPerformed

    private void jMenuItem32ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem32ActionPerformed
        AbreJanela(cfv);
    }//GEN-LAST:event_jMenuItem32ActionPerformed

    private void jMenuItem29ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem29ActionPerformed
        AbreJanela(cu);
    }//GEN-LAST:event_jMenuItem29ActionPerformed

    private void jMenuItem30ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem30ActionPerformed
        carregaAnoSemestre();
    }//GEN-LAST:event_jMenuItem30ActionPerformed

    private void jbAnoSemestreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbAnoSemestreActionPerformed
        alterarAnoSemestre uas = new alterarAnoSemestre(null,true);
        uas.setLocation((index.tela.width-uas.getWidth())/2, (index.tela.height-uas.getHeight())/2);
        uas.setVisible(true);
        if(uas.finaliza){
            jbAnoSemestre.setText(periodo.get(0)+"/"+periodo.get(1));
        }
    }//GEN-LAST:event_jbAnoSemestreActionPerformed

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                if(System.getProperty("os.name").equals("Linux")){
                    raiz = System.getProperty("user.dir");
                }else{
                    raiz = System.getProperty("user.dir");
                }
                lexicoArquivo.arquivo();
                LoginVer lgv = new LoginVer();
                lgv.setLocation((index.tela.width-lgv.getWidth())/2, (index.tela.height-lgv.getHeight())/2);
                lgv.setVisible(true);
            }
        });
    }

    private static boolean verificaJanelaAbertas(JDesktopPane deskPane,JInternalFrame frame){
        boolean janela=false;
        JInternalFrame[] results;
        results = deskPane.getAllFrames();
        for (int i = 0 ; i < results.length ; i++){
            if(results[i].equals(frame)){
//                deskPane.remove(i);
                janela=true;
            }
        }
        return janela;
    }

    private void AbreJanela(JInternalFrame Janela){
        if(!verificaJanelaAbertas(desktopPane, Janela)){
            try { 
                desktopPane.add(Janela);
                Janela.setVisible(true);
                Janela.setMaximum(true);
                Janela.show();
            } catch (PropertyVetoException ex) {
                verErros.setErro(ex.getMessage());
            } 
        }else{
            try{
                Janela.setIcon(false);
                Janela.setVisible(true);
                Janela.setSelected(true);
                Janela.setFocusable(true);
            }catch(Exception ex){
                verErros.setErro(ex.getMessage());
                Janela = null;
            }
        }
    }
    private void carregaAnoSemestre(){
        try {
            conexao.Query("select ano,semestre from grade_turma where cod_emp="+index.cod_emp+" group by ano,semestre order by ano DESC, semestre DESC Limit 1");
            conexao.rs.next();
            periodo.add(0,conexao.rs.getString("ano"));
            periodo.add(1,conexao.rs.getString("semestre"));
            jbAnoSemestre.setText(conexao.rs.getString("ano")+"/"+conexao.rs.getString("semestre"));
        } catch (SQLException ex) {
            verErros.setErro(ex.getMessage());
        }
    }
    
    public static void maiusculo(JTextField obj, java.awt.event.KeyEvent evt){
        if(evt.getKeyCode()!= 8 || evt.getKeyCode()!=32 || evt.getKeyCode()!=36 || evt.getKeyCode()!=16){
            obj.setText(obj.getText().toUpperCase());
        }
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem aboutMenuItem;
    private javax.swing.JDesktopPane desktopPane;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu10;
    private javax.swing.JMenu jMenu11;
    private javax.swing.JMenu jMenu12;
    private javax.swing.JMenu jMenu13;
    private javax.swing.JMenu jMenu14;
    private javax.swing.JMenu jMenu15;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenu jMenu7;
    private javax.swing.JMenu jMenu8;
    private javax.swing.JMenu jMenu9;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem11;
    private javax.swing.JMenuItem jMenuItem12;
    private javax.swing.JMenuItem jMenuItem13;
    private javax.swing.JMenuItem jMenuItem14;
    private javax.swing.JMenuItem jMenuItem15;
    private javax.swing.JMenuItem jMenuItem16;
    private javax.swing.JMenuItem jMenuItem17;
    private javax.swing.JMenuItem jMenuItem18;
    private javax.swing.JMenuItem jMenuItem19;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem20;
    private javax.swing.JMenuItem jMenuItem21;
    private javax.swing.JMenuItem jMenuItem22;
    private javax.swing.JMenuItem jMenuItem23;
    private javax.swing.JMenuItem jMenuItem24;
    private javax.swing.JMenuItem jMenuItem25;
    private javax.swing.JMenuItem jMenuItem27;
    private javax.swing.JMenuItem jMenuItem28;
    private javax.swing.JMenuItem jMenuItem29;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem30;
    private javax.swing.JMenuItem jMenuItem31;
    private javax.swing.JMenuItem jMenuItem32;
    private javax.swing.JMenuItem jMenuItem33;
    private javax.swing.JMenuItem jMenuItem34;
    private javax.swing.JMenuItem jMenuItem35;
    private javax.swing.JMenuItem jMenuItem36;
    private javax.swing.JMenuItem jMenuItem37;
    private javax.swing.JMenuItem jMenuItem38;
    private javax.swing.JMenuItem jMenuItem39;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem40;
    private javax.swing.JMenuItem jMenuItem41;
    private javax.swing.JMenuItem jMenuItem42;
    private javax.swing.JMenuItem jMenuItem43;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JToolBar.Separator jSeparator1;
    private javax.swing.JPopupMenu.Separator jSeparator12;
    private javax.swing.JToolBar.Separator jSeparator2;
    private javax.swing.JPopupMenu.Separator jSeparator6;
    private javax.swing.JPopupMenu.Separator jSeparator7;
    private javax.swing.JToolBar.Separator jSeparator8;
    private javax.swing.JToolBar.Separator jSeparator9;
    private javax.swing.JToggleButton jToggleButton1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JButton jbAnoSemestre;
    private javax.swing.JLabel jlRelogio;
    private javax.swing.JMenuBar menuBar;
    // End of variables declaration//GEN-END:variables

}
